<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:if test="${pageBean.totalCount > 0 }">
<input type="hidden" class="pageNum" name="p" value="${pageBean.currentPage }">
<!-- 翻页paginationBox -->
<div id="pagination" class="paginationBox pagination " total="${pageBean.totalPage}">
	<div class="pagNumber fl">
		共<span class="darkred totalCount">${pageBean.totalCount }</span>条记录，共<span class="totalPage">${pageBean.totalPage}</span>页
		<input type="text" class="inputNumber toPageNum"><button class="gotoPage noajax button button1" type="button">跳转</button>
	</div>
	<ul class="pagination fr">
		<c:if test="${pageBean.currentPage <= 1}">
			<li class="disabled"><a aria-label="Previous" href="javascript:void(0);"><b aria-hidden="true">«</b></a></li>
		</c:if>
		<c:if test="${pageBean.currentPage > 1}">
			<li><a aria-label="Previous" href="javascript:void(0);" class="pageBtn2" v="${pageBean.currentPage -1}"><b aria-hidden="true">«</b></a></li>
		</c:if>
		<c:if test="${pageBean.totalPage < 10}">
			<c:forEach begin="1" end="${pageBean.totalPage}" varStatus="var">
				<c:choose>
					<c:when test="${pageBean.currentPage eq var.index}">
						<li class="active"><a href="javascript:void(0);">${var.index}</a></li>
					</c:when>
					<c:otherwise>
						<li><a href="javascript:void(0);" v="${var.index}">${var.index}</a></li>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</c:if>
		<c:if test="${pageBean.totalPage >= 10}">
			<c:choose>
				<c:when test="${pageBean.currentPage <= 5}">
					<c:forEach begin="1" end="9" varStatus="var">
						<c:choose>
							<c:when test="${pageBean.currentPage eq var.index}">
								<li class="active"><a href="javascript:void(0);">${var.index}</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="javascript:void(0);" v="${var.index}">${var.index}</a></li>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</c:when>
				<c:when test="${pageBean.currentPage >= pageBean.totalPage - 4}">
					<c:forEach begin="${pageBean.totalPage - 8}" end="${pageBean.totalPage}" varStatus="var">
						<c:choose>
							<c:when test="${pageBean.currentPage eq var.index}">
								<li class="active"><a href="javascript:void(0);">${var.index}</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="javascript:void(0);" v="${var.index}">${var.index}</a></li>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</c:when>
				<c:otherwise>
					<c:forEach begin="1" end="9" varStatus="var">
						<c:choose>
							<c:when test="${pageBean.currentPage eq pageBean.currentPage - 5 + var.index}">
								<li class="active"><a href="javascript:void(0);">${pageBean.currentPage - 5 + var.index}</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="javascript:void(0);" v="${pageBean.currentPage - 5 + var.index}">${pageBean.currentPage - 5 + var.index}</a></li>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</c:otherwise>
			</c:choose>
		</c:if>
		<c:if test="${pageBean.currentPage == pageBean.totalPage}">
			<li class="disabled"><a aria-label="Next" href="javascript:void(0);"><b aria-hidden="true">»</b></a></li>
		</c:if>
		<c:if test="${pageBean.currentPage < pageBean.totalPage}">
			<li><a aria-label="Next" href="javascript:void(0);" class="pageBtn2" v="${pageBean.currentPage +1}"><b aria-hidden="true">»</b></a></li>
		</c:if>
	</ul>
</div>
</c:if>